'''
with open("需求.txt", mode='w', encoding='utf-8') as fp:
    fp.write("需求\n")
    fp.write("card类 --->  卡号 密码 余额 锁定状态\n")
    fp.write("person 类")
    fp.write("用户名 身份证 电话 卡\n")
    fp.write("view 类\n")
    fp.write("operation 类\n")
'''

# ### 主入口文件
from atmpackage import card
from atmpackage import operation
from atmpackage import person
from atmpackage import view

'''
卡号:401689
密码:212222
新密:123456
Shift + Tab
'''

class Main():
    #现在只能类调 要让类和对象都能调 使用 @staticmethod
    @staticmethod
    def run():
        if view.View.login():
            #相应操作方法
            obj = operation.Operation()
            while True:
                choice = input("请选择要办理的业务:")
                if choice == "1":
                    obj.register()
                elif choice == "2":
                    obj.query()
                elif choice == "3":
                    obj.save_money()
                elif choice == "4":
                    obj.get_money()
                elif choice == "5":
                    obj.trans_money()
                elif choice == "6":
                    obj.change_pwd()
                elif choice == "7":
                    obj.lock()
                elif choice == "8":
                    obj.unlock()
                elif choice == "9":
                    obj.new_card()
                elif choice == "0":
                    print("即将退出...")
                    obj.save()
                    break
                else:
                    print("输入有误 请输入0-9")

        else:
            pass


if __name__ == "__main__":
    Main.run()